<template>
  <view class="aboutus-page borderPad">
    <view class="aboutus-card">
      <view class="aboutus-logo">
        <image src="https://fengqinghui.oss-cn-hangzhou.aliyuncs.com/monkey/monkey/logo-2.png" mode="aspectFit" />
      </view>
      <view class="aboutus-title font-color-red f-s-36">魔力猴</view>
      <view class="aboutus-slogan f-s-28 text-666 mt15 mb15">点亮学习之路，发现更好的自己</view>
      <view class="aboutus-desc-card">
        <view class="aboutus-desc f-s-28 text-333">
          <view v-html="htmlData"></view>
        </view>
      </view>
      <view class="aboutus-feature-list mt20">
        <view class="aboutus-feature-item acea-row row-middle mb24" v-for="(item, idx) in usData.activityDescResponses" :key="idx">
          <view class="aboutus-feature-icon-box">
            <image class="aboutus-feature-icon" :src="item.icon" mode="aspectFit" />
          </view>
          <view class="aboutus-feature-content ml10">
            <view class="aboutus-feature-title font-color-red f-s-28">{{ item.title }}</view>
            <view class="aboutus-feature-desc f-s-24 text-666">{{ item.content }}</view>
          </view>
        </view>
      </view>
      <view class="aboutus-contact-card mt24">
        <button class="aboutus-btn" @click="mailto">联系我们：{{usData.website}}</button>
        <button class="aboutus-btn" @click="call">客服电话：{{usData.phone}}</button>
      </view>
    </view>
  </view>
</template>

<script>
import {getAgreementAboutusinfo, getAgreementContactUs} from "../../../api/new";

export default {
  name: "index",
  data() {
    return {
      htmlData:'',
      usData:'',
    }
  },
  onLoad(){
    getAgreementAboutusinfo().then(res=>{
      this.htmlData = JSON.parse(res.data).agreement
    })
    getAgreementContactUs().then(res=>{
      this.usData = res.data
    })
  },
  methods: {
    call() {
      uni.makePhoneCall({ phoneNumber: '4001234567' })
    },
    mailto() {
      // #ifdef H5
      window.location.href = 'mailto:service@molihou.com';
      // #endif
      // #ifdef MP-WEIXIN || APP-PLUS
      uni.setClipboardData({ data: 'service@molihou.com', success:()=>{
        uni.showToast({ title: '邮箱已复制', icon: 'none' })
      }});
      // #endif
    }
  }
}
</script>

<style scoped lang="scss">
.aboutus-page {
  min-height: 100vh;
  background: #FCFAF6;
  padding-top: 48rpx;
  padding-bottom: 48rpx;
}
.aboutus-card {
  background: #fff;
  border-radius: 16rpx;
  box-shadow: 0 2rpx 8rpx rgba(139, 69, 19, 0.06);
  padding: 40rpx 32rpx 32rpx 32rpx;
  max-width: 700rpx;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.aboutus-logo {
  width: 120rpx;
  height: 120rpx;
  border-radius: 20rpx;
  margin-bottom: 12rpx;
  background: #f3e1d2;
  padding: 10px;
  image{
    width: 100%;
    height: 100%;
  }
}
.aboutus-title {
  margin-bottom: 8rpx;
  font-weight: bold;
  letter-spacing: 2rpx;
}
.aboutus-slogan {
  text-align: center;
}
.aboutus-desc-card {
  width: 100%;
  background: #fff;
  border-radius: 16rpx;
  box-shadow: 0 2rpx 8rpx rgba(139, 69, 19, 0.06);
  padding: 32rpx 24rpx;
  margin-bottom: 24rpx;
}
.aboutus-desc {
  line-height: 1.8;
}
.aboutus-feature-list {
  width: 100%;
}
.aboutus-feature-item {
  background: #fff;
  border-radius: 16rpx;
  box-shadow: 0 2rpx 8rpx rgba(139, 69, 19, 0.06);
  padding: 24rpx 18rpx;
  align-items: center;
}
.aboutus-feature-icon-box {
  width: 64rpx;
  height: 64rpx;
  background: #f3e1d2;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.aboutus-feature-icon {
  width: 40rpx;
  height: 40rpx;
}
.aboutus-feature-content {
  flex: 1;
}
.aboutus-feature-title {
  margin-bottom: 4rpx;
}
.aboutus-contact-card {
  width: 100%;
  background: #fff;
  border-radius: 16rpx;
  box-shadow: 0 2rpx 8rpx rgba(139, 69, 19, 0.06);
  padding: 24rpx 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18rpx;
}
.aboutus-btn {
  width: 90%;
  background: #fff;
  border: 2rpx solid #8B4513;
  color: #8B4513;
  border-radius: 24rpx;
  padding: 18rpx 0;
  font-size: 28rpx;
  margin: 0 auto;
  margin-bottom: 0;
  box-shadow: 0 2rpx 8rpx rgba(139, 69, 19, 0.04);
  transition: box-shadow 0.2s, background 0.2s;
}
.aboutus-btn:active {
  background: #f3e1d2;
  box-shadow: 0 4rpx 16rpx rgba(139, 69, 19, 0.12);
}
</style>